package com.gpb.common.utils;

import java.net.URI;


/**
 * web 工具
 * @author 郭彭彬
 *
 */
public class WebUtils {

	/**
	 * 获取项目物理路径
	 * @return
	 */
	public static String webRoot(){
		String path=null;
		try {
			URI uri = new URI(WebUtils.class.getResource("/").toString());
			path=uri.getPath().substring(1);
		} catch (Exception e) {
			e.printStackTrace();
		}
		int endIndex=path.indexOf("WEB-INF/classes/");
		return path.substring(0,endIndex);
	}
	
	public static void main(String[] args) {
		System.out.println(WebUtils.webRoot());
	}
}
